package p2pcdnsim.network;


public class ClientNode implements Node {

	private long id;
	NetworkLayer net;
	Link lanBUS;

	public ClientNode(long nodeID) {
		this.id = nodeID;
	}

	public long getNodeId() {
		return id;
	}

	public void setNetworkLayer(NetworkLayer net) {
		this.net = net;
		net.setNode(this);
	}

	public void receivePacket(Packet p) {
		if(net!=null)
			net.addPacket(p);
	}

	public NetworkLayer getNetworkLayer() {
		return net;
	}

	public Link getDefaultLink() {
		return lanBUS;
	}

	public void setLinkBus(LANBus linkBus) {
		this.lanBUS = linkBus;
	}

	@Override
	public String getName() {
		return "ClientNode"+id;
	}
}
